package com.sb.framework.exception;

import com.sb.framework.bean.ErrorCode;
import com.sb.framework.support.PropertyContext;

public class BusinessException extends RuntimeException {

	private static final long	serialVersionUID	= 6018093127903356667L;

	private ErrorCode			code;
	private String				message;

	public BusinessException(ErrorCode code, String message) {
		this.code = code;
		this.message = message;
	}

	public BusinessException(ErrorCode code) {
		this( code, PropertyContext.getProperty( code.getCode() ) );
	}

	public String getCode() {
		return code.getCode();
	}

	public String getMessage() {
		return message;
	}

	BusinessException() {

	}
}